include_once TEMPLATEPATH . '/functions/functions.php';
$functions_path = STYLESHEETPATH . '/functions/';
/* These files build out the options interface. Likely won't need to edit these. */
require_once ($functions_path . 'admin-functions.php'); // Custom functions and plugins
require_once ($functions_path . 'admin-interface.php'); // Admin Interfaces (options,framework, seo)
/* These files build out the theme specific options and associated functions. */
require_once ($functions_path . 'theme-options.php'); // Options panel settings and custom settings
require("includes/theme-widgets.php"); // To Show The Extra Widgets
?>
define('FUNCTIONPATH', TEMPLATEPATH . '/functions/');
define('LIBPATH', FUNCTIONPATH . 'lib/');
define('LIBURL', get_template_directory_uri() . '/functions/lib/');
?>
if ( ! function_exists( 'foundation_setup' ) ) :
function foundation_setup() {
// Content Width
if ( ! isset( $content_width ) ) $content_width = 900;
// Language Translations
load_theme_textdomain( 'foundation', get_template_directory() . '/languages' );
// Custom Editor Style Support
add_editor_style();
// Support for Featured Images
add_theme_support( 'post-thumbnails' );
// Automatic Feed Links & Post Formats
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );
}
add_action( 'after_setup_theme', 'foundation_setup' );
endif;
/**
* Initialise Foundation JS
* @see: http://foundation.zurb.com/docs/javascript.html
*/
if ( ! function_exists( 'foundation_js_init' ) ) :
function foundation_js_init () {
//echo '';
}
add_action('wp_footer', 'foundation_js_init', 50);
endif;
/**
* ZeptoJS and jQuery Fallback
* @see: http://foundation.zurb.com/docs/javascript.html
*/
if ( ! function_exists( 'foundation_comptability' ) ) :
/*function foundation_comptability () {
echo "";
} */
add_action('wp_footer', 'foundation_comptability', 10);
endif;
/**
* Register Navigation Menus
*/
function register_my_menus() {
register_nav_menus(
array(
'main_menu' => 'Header_Menu',
'footer_main_menu' => 'Footer Menu'
));
}
add_action( 'init', 'register_my_menus' );
/**
* Create pagination
*/
if ( ! function_exists( 'foundation_pagination' ) ) :
function foundation_pagination() {
global $wp_query;
$big = 999999999;
$links = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'prev_next' => true,
'prev_text' => '«',
'next_text' => '»',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'type' => 'list'
)
);
$pagination = str_replace('page-numbers','pagination',$links);
echo $pagination;
}
endif;
/**
* Custom Avatar Classes
*/
if ( ! function_exists( 'foundation_avatar_css' ) ) :
function foundation_avatar_css($class) {
$class = str_replace("class='avatar", "class='author_gravatar left ", $class) ;
return $class;
}
add_filter('get_avatar','foundation_avatar_css');
endif;
/**
* Custom Post Excerpt
*/
if ( ! function_exists( 'foundation_excerpt' ) ) :
function foundation_excerpt($text) {
global $post;
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace('\]\]\>', ']]>', $text);
$text = preg_replace('@@si', '', $text);
$text = strip_tags($text, '
');
$excerpt_length = 80;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words)> $excerpt_length) {
array_pop($words);
array_push($words, '
' . __('Continue Reading', 'foundation') . '');
$text = implode(' ', $words);
}
}
return $text;
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'foundation_excerpt');
endif;
/**
* Comments Template
*/
if ( ! function_exists( 'foundation_comment' ) ) :
function foundation_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>